package com.cennavi.controller;

import com.cennavi.service.FormulaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * Created by lixiaoshuang on 2018/10/17.
 */
@Controller
@RequestMapping("/formula")
public class FormulaController {
    @Autowired
    FormulaService formulaService;

    @RequestMapping("insertViem")
    public String insertViem(HttpServletRequest request,
                                 HttpServletResponse response,
                                              Map<String, Object> map){


        return "add";

    }


    @RequestMapping("insertFormula")
    public @ResponseBody Object insertFormula(HttpServletRequest request,
                                              HttpServletResponse response,
                                              Map<String, Object> map){
        try {
            formulaService.insertData(map);
        }catch (Exception e){

        }
        return "成功";

    }


}
